<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="imgUpload.css">
  <script src="imgUpload.js"></script>
</head>

<body>
  <p>上传图片，单击图片取消</p>
  <div class="name"></div>
</body>
<script>
  let img = new imgUpload('.name')
  img.onEvent('data', function (e) {
    console.log(e.detail);
  })
</script>

</html>